package org.yscz.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import org.springframework.web.multipart.MultipartFile;
import org.yscz.entity.Testee;
import org.yscz.entity.TesteeGroup;
import org.yscz.entity.vo.TesteeVo;
import org.yscz.mapper.RecordMapper;
import org.yscz.mapper.TesteeGroupMapper;
import org.yscz.mapper.TesteeMapper;
import org.yscz.service.TesteeGroupService;
import org.yscz.service.TesteeService;
import org.yscz.utils.EasyPoiUtil;

import javax.annotation.Resource;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;

/**
 * @program: pe
 * @description: 被测人业务层实现类
 * @author: muqs
 * @create: 2021-08-22
 **/
@Service
@Slf4j
public class TesteeGroupServiceImpl extends ServiceImpl<TesteeGroupMapper, TesteeGroup> implements TesteeGroupService {
    @Resource
    private TesteeGroupMapper testeeGroupMapper;

    @Override
    public List<TesteeGroup> selectTesteeGroupByParentIdAndProjectId(Long parentId, Long projectId) {
        QueryWrapper<TesteeGroup> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("parent_id", parentId);
        queryWrapper.eq("project_type_id_fk", projectId);
        List<TesteeGroup> testeeGroups = testeeGroupMapper.selectList(queryWrapper);
        return testeeGroups;
    }
}
